package com.ruoyi.business.domain;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;
import java.util.List;

/**
 * 台架设备对象 rack_equipment
 * 
 * @author qiancheng
 * @date 2025-06-13
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("rack_equipment")
public class RackEquipment extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 台架设备ID */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    /** 设备名称 */
    @Excel(name = "设备名称")
    @TableField(value = "equipment_name")
    private String equipmentName;

    /** 型号 */
    @Excel(name = "型号")
    @TableField(value = "model")
    private String model;

    /** 购置时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "购置时间", width = 30, dateFormat = "yyyy-MM-dd")
    @JSONField(format = "yyyy-M-d")
    @TableField(value = "pur_time")
    private Date purTime;

    /** 厂家 */
    @Excel(name = "厂家")
    @TableField(value = "manufacturer")
    private String manufacturer;

    /** 使用时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "使用时间", width = 30, dateFormat = "yyyy-MM-dd")
    @TableField(value = "use_time")
    private Date useTime;

    /** 设备定位 */
    @Excel(name = "设备定位")
    @TableField(value = "equipment_location")
    private String equipmentLocation;

    /** 操作（如查看 ） */
    @Excel(name = "操作", readConverterExp = "如=查看")
    @TableField(value = "operation")
    private String operation;

    /** 所属台架ID */
    @Excel(name = "所属台架ID")
    @TableField(value = "rack_id")
    private String rackId;

    /** 所属图纸 */
    @Excel(name = "所属图纸")
    @TableField(value = "draw")
    private String draw;


    /** 预览图纸 */
    @TableField(exist = false)
    private List<String> draws;

    /** 维护时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @TableField(exist = false)
    private Date maintenanceTime;

    /**
     * 状态 1：正常 2：异常
     */
    @TableField(exist = false)
    private int status;
}
